%% 末段ENU转化为XYZ XYZ转化为LLA
clc
clear
lon0 = 50.5*pi/180;
lat0 = 50.5*pi/180;
load('ITCG1.mat')
t1 = ITCG1(:,1);
x1 = ITCG1(:,2);
y1 = ITCG1(:,3);
z1 = ITCG1(:,4);
[SZ1, ~] = size(ITCG1);
XYZ1 = nan(3,SZ1);
LLA1 = nan(3,SZ1);
for i = 1:SZ1
   XYZ1(:,i) = ENU2XYZ(x1(i), y1(i), z1(i), lat0, lon0);
   LLA1(:,i) = ecef2lla(XYZ1(:,i));
end

load('ITCG2.mat')
x2 = ITCG2(:,2);
y2 = ITCG2(:,3);
z2 = ITCG2(:,4);
[SZ2, ~] = size(ITCG2);
XYZ2 = nan(3,SZ2);
LLA2 = nan(3,SZ2);
for i = 1:SZ2
   XYZ2(:,i) = ENU2XYZ(x2(i), y2(i), z2(i), lat0, lon0);
   LLA2(:,i) = ecef2lla(XYZ2(:,i));
end

load('ITCG3.mat')
x3 = ITCG3(:,2);
y3 = ITCG3(:,3);
z3 = ITCG3(:,4);
[SZ3, ~] = size(ITCG3);
XYZ3 = nan(3,SZ3);
LLA3 = nan(3,SZ3);
for i = 1:SZ3
   XYZ3(:,i) = ENU2XYZ(x3(i), y3(i), z3(i), lat0, lon0);
   LLA3(:,i) = ecef2lla(XYZ3(:,i));
end